<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
    <head>
        <title></title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <script type="text/javascript" src="http://web.mcooz.com/js/jquery-1.11.1.min.js"></script>   
        <script type="text/javascript" charset="UTF-8" src="http://web.mcooz.com/js_source/artdialog/artDialog.source.js.js"></script>
        <script type="text/javascript" charset="UTF-8" src="http://web.mcooz.com/js_source/artdialog/plugins/iframeTools.source.js"></script>
        <link rel="stylesheet" type="text/css" href="http://web.mcooz.com/js_source/artdialog/skins/idialog.css" />
        
        <link rel="stylesheet" href="__PUBLIC__/assets/css/ace.min.css" />
        <link rel="stylesheet" href="__PUBLIC__/assets/css/ace-rtl.min.css" />
        <link rel="stylesheet" href="__PUBLIC__/assets/css/ace-skins.min.css" />
        <link href="__PUBLIC__/assets/css/bootstrap.min.css" rel="stylesheet" />
        <style>
.form-group {
  height: 51px;
}            
        </style>
            
        
    </head>

    <body style="width:300px;height:400px">
        <div class="row">
            <div class="col-xs-12">


                    <input name="act" value="edit" type="hidden">





                    <div class="space-4"></div>


                    <div class="form-group">
                        <label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 礼物名称 </label>

                        <div class="col-sm-9">
                            <input id="gift_name" name="gift_name" placeholder="" class="col-xs-10 col-sm-5" type="text">
                        </div>
                    </div>







                    <div class="space-4"></div>


                    <div class="form-group">
                        <label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 价值 </label>

                        <div class="col-sm-9">
                            <input id="price" name="price" placeholder="" class="col-xs-10 col-sm-5" type="text">
                        </div>
                    </div>



                    <div class="form-group">
                        <label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 图片 </label>

                        <div class="col-sm-9">
                            <input multiple="" name="file" id="id-input-file-3" type="file">

                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 获得经验值 </label>

                        <div class="col-sm-9">
                            <input id="score" name="score" placeholder="" class="col-xs-10 col-sm-5" type="text">
                        </div>
                    </div>


                    <div class="space-4"></div>




                    <div class="clearfix form-actions">
                        <div class="col-md-offset-3 col-md-9">
                            <button class="btn btn-info" type="button" id="submit">
                                <i class="icon-ok bigger-110" ></i>
                                确定
                            </button>

                        </div>
                    </div>





                    <div class="space-24"></div>








                <script>
$('#submit').on('click',function() {
                id = art.dialog.data('id');
                     var gift_name = $("#gift_name").val();
                    var price = $("#price").val();
                    var score = $("#score").val();
                    var url = '<{:U('Admin/update_gift_act')}>';
                    $.getJSON(url, {'gift_id': id,'gift_name': gift_name,'price': price,'score': score}, function (json)
                    {
                        
                       
                        
                        if(json.status==1){
                        var origin = artDialog.open.origin;
                        var gift_name_td = origin.document.getElementById('gift_name_'+id);
                        var price_td = origin.document.getElementById('price_'+id);
                        var score_td = origin.document.getElementById('score_'+id);
                        gift_name_td.innerHTML = gift_name;
                        price_td.innerHTML = price;
                        score_td.innerHTML = score;
                        art.dialog.close();
                        return false;
                        }
                         alert(json.message)
                        art.dialog.close();

                    });
                  
                       });
                </script>


            </div>
        </div>
    </body>
</html>
